load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("secure_pipes")

cpp_library(
    name = "token_binding",
    srcs = [
        "Types.cpp",
    ],
    headers = [
        "Types.h",
    ],
    deps = [
        "//folly:string",
        "//folly/io:iobuf",
    ],
    exported_deps = [
        "//fizz/record:record",
        "//folly:optional",
    ],
)

cpp_library(
    name = "token_binding_server_extension",
    headers = [
        "TokenBindingServerExtension.h",
    ],
    exported_deps = [
        ":token_binding",
        ":token_binding_context",
        "//fizz/server:negotiator",
        "//fizz/server:server_extensions",
    ],
)

cpp_library(
    name = "token_binding_client_extension",
    srcs = [
        "TokenBindingClientExtension.cpp",
    ],
    headers = [
        "TokenBindingClientExtension.h",
    ],
    exported_deps = [
        ":token_binding",
        ":token_binding_context",
        "//fizz/client:client_extensions",
        "//folly:optional",
    ],
)

cpp_library(
    name = "token_binding_context",
    headers = [
        "TokenBindingContext.h",
    ],
    exported_deps = [
        ":token_binding",
    ],
)

cpp_library(
    name = "token_binding_validator",
    srcs = [
        "Validator.cpp",
    ],
    headers = [
        "Validator.h",
    ],
    deps = [
        ":utils",
    ],
    exported_deps = [
        ":token_binding",
        "//fizz/backend:openssl",
        "//fizz/record:record",
    ],
)

cpp_library(
    name = "utils",
    headers = [
        "Utils.h",
    ],
    exported_deps = [
        ":token_binding",
    ],
)

cpp_library(
    name = "token_binding_constructor",
    srcs = [
        "TokenBindingConstructor.cpp",
    ],
    headers = [
        "TokenBindingConstructor.h",
    ],
    deps = [
        ":utils",
        "//fizz/backend:openssl",
    ],
    exported_deps = [
        ":token_binding",
        "//folly/ssl:openssl_ptr_types",
    ],
)
